package lesson02;

public class Demo_205 {
    public static void main(String[] args) throws InterruptedException {
        Thread  thread=new Thread(()->{
            while (!Thread.currentThread().isInterrupted()){//判断线程是否中断
                System.out.println("hhh");
            }
            System.out.println("no");
        });
        thread.start();
        thread.isAlive();
        Thread.sleep(500);
        thread.interrupt();
        thread.isAlive();
    }
}
